after_effects_extendscript_snippets_2
snippet | |
---|---|
var main_window = new Window("palette","Defaults",undefined); main_window.orientation = "column"; main_window.center(); main_window.show(); | |
var default_file = File("~/Desktop/defaults.txt"); if(!default_file.exists){ alert("file doent exist"); } else{} | |
var main_window = new Window("palette","Defaults",undefined); main_window.orientation = "column"; var group_2 = main_window.add("group",undefined,"group_2"); group_2.orientation = "row"; var reset_button = group_2.add("button",undefined,"reset"); main_window.center(); main_window.show(); | |
var main_window = new Window("palette","Defaults",undefined); main_window.orientation = "column"; var group_1 = main_window.add("group",undefined,"group_1"); group_1.orientation = "row"; var check_box=group_1.add("checkbox",undefined,"true"); main_window.center(); main_window.show(); | |
var main_window = new Window("palette","Defaults",undefined); main_window.orientation = "column"; var group_1 = main_window.add("group",undefined,"group_1"); group_1.orientation = "row"; var edit_text= group_1.add("edittext",undefined,"hello"); main_window.center(); main_window.show(); | |
var default_file = File("~/Desktop/defaults.txt"); if(!default_file.exists){ default_file.open("W"); default_file.write("true\rtutorial"); default_file.close(); } else{} | |
var main_window = new Window("palette","Defaults",undefined); main_window.orientation = "column"; main_window.show(); | |
var main_window = new Window("palette","Defaults",undefined); main_window.orientation = "column"; var group_2 = main_window.add("group",undefined,"group_2"); group_2.orientation = "row"; var reset_button = group_2.add("button",undefined,"reset"); reset_button.onClick = function(){ alert("button pushed"); } | |
var main_window = new Window("palette","color button",undefined); main_window.orientation = "column"; var color_button_1 = main_window.add("button",undefined,""); color_button_1.size = [30,30]; color_button_1.fillBrush = color_button_1.graphics.newBrush(color_button_1.graphics.BrushType.SOLID_COLOR,[1,.5,.2]); color_button_1.onDraw = costum_draw; main_window.center(); main_window.show(); function costum_draw() {with(this){ graphics.drawOSControl(); graphics.rectPath(0,0,size[0],size[1]); graphics.fillPath(fillBrush); } } | |
function costum_draw() {with(this){ graphics.drawOSControl(); graphics.rectPath(0,0,size[0],size[1]); graphics.fillPath(fillBrush); } } function update_color_button(button,color){ } var main_window = new Window("palette","color button",undefined); main_window.orientation = "column"; var color_button_1 = main_window.add("button",undefined,""); color_button_1.size = [30,30]; color_button_1.fillBrush = color_button_1.graphics.newBrush(color_button_1.graphics.BrushType.SOLID_COLOR,[1,.5,.2]); color_button_1.onDraw = costum_draw; main_window.center(); main_window.show(); var hex = "0xFF8033"; color_button_1.onClick = function(){ var color_picker = $.colorPicker(hex); } | |
var default_file = File("~/Desktop/defaults.txt"); default_file.open("r"); while(!default_file.eof){ defaults_array.push(default_file.readln().toString()); } | |
var default_file = File("~/Desktop/defaults.txt"); | |
function costum_draw() {with(this){ graphics.drawOSControl(); graphics.rectPath(0,0,size[0],size[1]); graphics.fillPath(fillBrush); } } function update_color_button(button,color){ button.fillBrush = button.graphics.newBrush(button.graphics.BrushType.SOLID_COLOR,color); button.onDraw = costum_draw; button.enabled = false; button.enabled = true; } var main_window = new Window("palette","color button",undefined); main_window.orientation = "column"; var color_button_1 = main_window.add("button",undefined,""); color_button_1.size = [30,30]; color_button_1.fillBrush = color_button_1.graphics.newBrush(color_button_1.graphics.BrushType.SOLID_COLOR,[1,.5,.2]); color_button_1.onDraw = costum_draw; main_window.center(); main_window.show(); var hex = "0xFF8033"; color_button_1.onClick = function(){ var color_picker = $.colorPicker(hex); if(color_picker!=-1){ hex = color_picker; var r = color_picker>>16; var g = (color_picker&0x00ff00)>>8; var b = color_picker&0xff; update_color_button(color_button_1,[r/255,g/255,b/255]); } else{ } } | |
check_box.value=true; check_box.value=false; | |
var x,y,width,height; var size_window = new Window("palette","size window",undefined); size_window.orientation = "column"; var size_group = size_window.add("group",undefined,"size_group"); size_group.orientation = "row"; var width_edit_text=size_group.add("edittext",undefined,"width"); width_edit_text.size = [50,25]; var height_edit_text= size_group.add("edittext",undefined,"height"); height_edit_text.size=[50,25]; var size_ok_button = size_window.add("button",undefined,"ok"); var position_window = new Window("palette","position window",undefined); position_window.orientation = "column"; var position_group = position_window.add("group",undefined,"position_group"); position_group.orientation = "row"; var x_edit_text=position_group.add("edittext",undefined,"x"); x_edit_text.size = [50,25]; var y_edit_text= position_group.add("edittext",undefined,"y"); y_edit_text.size=[50,25]; var position_ok_button = position_window.add("button",undefined,"ok"); size_window.center(); size_window.show(); size_ok_button.onClick = function(){ size_window.hide(); width = parseInt(width_edit_text.text); height = parseInt(height_edit_text.text); position_window.center(); position_window.show(); } position_ok_button.onClick = function(){ position_window.hide(); x= parseInt(x_edit_text.text); y = parseInt(y_edit_text.text); main_window = new Window("palette","costume sized window",[x,y,width+x,height+y]); main_window.show(); } | |
var defaults_array = []; var default_file = File("~/Desktop/defaults.txt"); if(!default_file.exists){ default_file.open("W"); default_file.write("true\rinserted_text"); default_file.close(); } else{ default_file.open("r"); while(!default_file.eof){ defaults_array.push(default_file.readln().toString()); } } var main_window = new Window("palette","Defaults",undefined); main_window.orientation = "column"; var group_1 = main_window.add("group",undefined,"group_1"); group_1.orientation = "row"; var check_box=group_1.add("checkbox",undefined,"true"); if(defaults_array[0]=="true"){check_box.value=true;} var edit_text= group_1.add("edittext",undefined,"hello"); edit_text.text = defaults_array[1]; var group_2 = main_window.add("group",undefined,"group_2"); group_2.orientation = "row"; var reset_button = group_2.add("button",undefined,"reset"); var save_button = group_2.add("button",undefined,"save"); reset_button.onClick = function(){ default_file.open("W"); default_file.write("true\rinserted_text"); default_file.close(); } save_button.onClick = function(){ default_file.open("W"); default_file.write(check_box.value.toString()+"\r"+edit_text.text); default_file.close(); } main_window.center(); main_window.show(); | |
var default_file = File("~/Desktop/defaults.txt"); while(!default_file.eof){ alert(default_file.readln().toString()); } | |
var default_file = File("~/Desktop/defaults.txt"); if(!default_file.exists){ default_file.open("W"); default_file.write("true\rtutorial"); default_file.close(); } else{} | |
var default_file = File("~/Desktop/defaults.txt"); if(!default_file.exists){ default_file.open("W"); default_file.write("true\rtutorial"); default_file.close(); } else{} | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx | |
xxx |